home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / delxdir.lha / paz / Ddir.asm
Encoding:
Assembly Source File  |  1993-04-18  |  33.5 KB  |  1,176 lines

  1.  
  2. *
  3. *        DeluxeDirectory 
  4. *
  5. *        written by Gerson Kurz
  6. *
  7.  
  8. ; Puh! Extensive documentation done on Sept.6,1991 due to popular demand 
  9. ; if you have better comments (or you find bugs etc) feel free to remove em
  10. ; as long as you send me a copy !!
  11.  
  12. ;OVERSCAN    =    1
  13.  
  14. version        MACRO
  15.         dc.b    "3.4"
  16.         ENDM
  17.  
  18. MAX_PATHSIZE    equ    1024
  19.  
  20.         incdir    'include:'
  21.         macfile    'lvo/exec.i'            _LVOxxx for exec.library
  22.         macfile    'lvo/dos.i'            _LVOxxx for dos.library
  23.         macfile    'lvo/utility.i'
  24.         macfile    'macro.i'            several macros
  25.         macfile    'dos/rdargs.i'            argument parsing
  26.         macfile    'dos/dosasl.i'            file matching
  27.         macfile    'dos/datetime.i'        date comparison
  28.         macfile    'dos/dosextens.i'        filehandler structure
  29.         macfile    'exec/libraries.i'        for OS2.0 check
  30.         macfile    'utility/utility.i'
  31.  
  32. ;        => \1:STRING TO PRINT, [\2:VALUES FOR STRING]
  33.  
  34. printf        MACRO            printf for blank messages only
  35.         IFGT    NARG-1
  36.         MOVE.L    #\2,D2        = arguments
  37.         ELSE
  38.         MOVEQ    #0,D2        no arguments needed
  39.         ENDC
  40.         MOVE.L    #\1,D1        = string
  41.         PUSHR    a5        since a5 seems to be trashed by this function
  42.         CALL    VPrintf        print string to default output
  43.         PULLR    a5        restore a5
  44.         ENDM
  45.  
  46. printfc        MACRO            printf for colored/blank messages mixed
  47.         IFGT    NARG-1
  48.         MOVE.L    #\2,D2        = arguments
  49.         ELSE
  50.         MOVEQ    #0,D2        no arguments needed
  51.         ENDC
  52.         MOVE.L    #\1,D1        = string
  53.         TST.L    (arg.nocolor)    test if colored message available 
  54.         BNE.B    .PRINTF_\@    no, it ain't
  55.         MOVE.L    #C_\1,D1    set color message
  56. .PRINTF_\@    PUSHR    a5        store a5 again
  57.         CALL    VPrintf        print string to default output
  58.         PULLR    a5        restore a5
  59.         ENDM
  60.  
  61.         bra.b    _start                enter program
  62.  
  63. ** Insert Version-String so that the CLI-Version-Command can always get it
  64.  
  65.         dc.b    0,'$VER: MDIR v'        version string !!
  66.         version
  67.         dc.b    ' by Gerson Kurz (Sept.6,1991)',10,0
  68.         cnop    0,4
  69.  
  70. _start        CLEARBSS                clear BSS section
  71.  
  72. ** Open DOS.LIBRARY for OS2.0 V36 or higher 
  73.  
  74.         lea    (dos.name,pc),a1        open dos.library V36++
  75.         moveq    #0,d0                no version number on first  try
  76.         CALL    OpenLibrary,exec.base        open library
  77.         move.l    d0,(dos.base)            save base
  78.         tst.l    d0                failure ?
  79.         beq    no.kick.2.0            yes, send message & quit
  80.         move.l    d0,a0                get dos.base
  81.         cmp.w    #36,(LIB_VERSION,a0)        test for OS2.0 version
  82.         blo    no.kick.2.0            no, quit
  83.  
  84.         lea    (utility.name,pc),a1        open dos.library V36++
  85.         moveq    #0,d0                no version number on first  try
  86.         CALL    OpenLibrary,exec.base        open library
  87.         move.l    d0,(utility.base)        save base
  88.         tst.l    d0                failure ?
  89.         beq    no.kick.2.0            yes, send message & quit
  90.  
  91. ** Read and parse the arguments from the input stream
  92.  
  93.         move.l    #arg.template,d1        template string for arguments
  94.         move.l    #arg.dirs,d2            first of the flags in a row [see definition]
  95.         moveq    #0,d3                no optional rdargs
  96.         CALL    ReadArgs,dos.base        read & parse arguments
  97.         tst.l    d0                error ?
  98.         beq    dos.error            yes, display error
  99.         move.l    d0,(arg.rdargs)            save adress to free memory
  100.  
  101.         tst.l    (arg.help)            help selected ?
  102.         bne    help                yes, show help
  103.  
  104. ** Check arguments for collisions & init argument defaults
  105.  
  106.         bsr    setupargs            enter subroutine
  107.  
  108. ** Setup NEWER/OLDER options if appropriate
  109.  
  110.         tst.l    (arg.newer)            NEWER-keyword there ?
  111.         beq.b    not.newer            no, cancel
  112.         move.l    (arg.newer),a0            get filename
  113.         bsr    open.cmpfile            open file and get date-string
  114.         cmp.l    #FALSE,d0            failure ?
  115.         beq    dos.error            yes, show dos-error        
  116. not.newer    
  117.         tst.l    (arg.older)            OLDER-keyword there ?
  118.         beq.b    not.older            no, cancel
  119.         move.l    (arg.older),a0            get filename
  120.         bsr    open.cmpfile            open file and get date-string
  121.         cmp.l    #FALSE,d0            failure ?
  122.         beq    dos.error            yes, show dos-error        
  123. not.older
  124.  
  125. ** Get current date [for head-display]
  126.  
  127.         lea    (datetime),a4            datetime buffer (from datetime.i)
  128.         move.b    #FORMAT_DOS,(dat_Format,a4)    format type = standard DOS
  129.         move.l    #StrDay.msg,(dat_StrDay,a4)    init day-msg
  130.         move.l    #StrDate.msg,(dat_StrDate,a4)    init date-msg
  131.         move.l    #StrTime.msg,(dat_StrTime,a4)    init time-msg
  132.         clr.b    (dat_Flags,a4)            no substitute allowed
  133.         move.l    a4,d1                get copy to d1
  134.         CALL    DateStamp            get current date
  135.         move.l    a4,d1                get another copy
  136.         CALL    DateToStr            get string from datestamp
  137.         tst.l    d0                error ?
  138.         beq    dos.error            yes, quit
  139.         bsr    norm.dates            check for 'DATES/NODATES' options
  140.  
  141. ** Check SINCE/UPTO options
  142.  
  143.         tst.l    (arg.since)            test SINCE keyword
  144.         beq.b    not.since            not valid
  145.         move.l    (arg.since),a1            date-string
  146.         bsr    get.cmpdate            get date value
  147.         tst.l    d0                error ?
  148.         beq    date.error            yes, quit
  149. not.since    tst.l    (arg.upto)            test UPTO keyword
  150.         beq.b    not.upto            not valid
  151.         move.l    (arg.upto),a1            date-string
  152.         bsr    get.cmpdate            get date value
  153.         tst.l    d0                error ?
  154.         beq    date.error            yes, quit
  155. not.upto    
  156.  
  157. ** Handle the multiple-directory strings
  158.  
  159.         move.l    (arg.dirs),a4            multiple DIR-strings
  160.         lea.l    (a4),a0                get current string
  161.         bsr    show.volume            show directory
  162.         tst.l    (a4)                are there any more ?
  163.         beq.b    done                no, done
  164.         tst.l    (4,a4)                are there really no more ?>
  165.         beq.b    done                no, done
  166.         addq.l    #4,a4                next string
  167. .loop        lea.l    (a4),a0                get string
  168.         bsr    show.volume            show directory
  169.         addq.l    #4,a4                next string        
  170.         tst.l    (a4)                done ?
  171.         bne.b    .loop                no loop
  172.  
  173. ** Return to CLI/Shell environment
  174.  
  175. done        bsr.b    close.args            close parse arguments
  176.         moveq    #RETURN_OK,d0            return value = OK
  177.         rts                    done !!
  178.  
  179. ** Close arguments ( the routine basically frees all allocated memory )
  180.  
  181. close.args    move.l    (arg.rdargs),d1            arguments
  182.         tst.l    d1                any valid ?
  183.         beq.b    1$                no, don't free them
  184.         CALL    FreeArgs,dos.base        free arguments
  185. 1$        tst.l    (utility.base)
  186.         beq.b    2$
  187.         move.l    (utility.base),a1
  188.         CALL    CloseLibrary,exec.base
  189. 2$        rts                    return
  190.  
  191. ** Display error if running below OS2.0
  192.  
  193. no.kick.2.0    move.l    #falsekick.msg,d2        message
  194.         moveq    #falsekick.size,d3        size of message
  195.         CALL    Output,dos.base            old printf for compatibility
  196.         CALL    Write                send to standard output
  197.         moveq    #RETURN_FAIL,d0            return = error
  198.         rts                    done
  199.  
  200. ** Display error if some date i/o failed
  201.  
  202. date.error    printf    dateerror.msg            special error message
  203.         bsr    close.args            close arguments
  204.         moveq    #RETURN_FAIL,d0            return = error
  205.         rts                    done
  206.  
  207. ** Display DOS-error
  208.  
  209. dos.error    CALL    IoErr,dos.base            get io error
  210.         move.l    d0,d1                copy error value
  211.         move.l    #err.head,d2            error header = 'ERROR:'
  212.         CALL    PrintFault            print errorstring
  213.         bsr    close.args            close arguments
  214.         moveq    #RETURN_FAIL,d0            return = error
  215.         rts                    done
  216.  
  217. help        printf    help.msg            show help message
  218.         bsr    close.args            close arguments
  219.         moveq    #RETURN_OK,d0            return = ok
  220.         rts                    done
  221.  
  222. ** Show directory => a0: name of directory/file/pattern
  223.  
  224. show.volume    PUSHALL                    save all registers
  225.         clr.l    (NROF_dirs)             clear directory counter
  226.         clr.l    (NROF_files)             clear file counter
  227.         clr.l    (NROF_bytes)             clear byte counter
  228.         clr.l    (NROF_blocks)            clear block counter
  229.         lea    (anchorpath),a1            anchor path
  230.         lea    (volname),a1            name of thee volume
  231.         move.l    (a0),a0                get name
  232. 1$        move.b    (a0)+,d0            get next char
  233.         move.b    d0,(a1)+            copy char
  234.         tst.b    d0                tst if end of string
  235.         bne.b    1$                no, loop
  236.         move.l    #volname,d1            name of thee volume
  237.         move.l    #SHARED_LOCK,d2            lock = shared (we're humble)
  238.         CALL    Lock,dos.base            lock volume
  239.         tst.l    d0                chk for error
  240.         beq    .nodirlock            yes, quit
  241.         move.l    d0,d6                copy lock
  242.         move.l    d0,d1                get lock
  243.         move.l    #fileinfoblock,d2        fileinfoblock
  244.         CALL    Examine                examine file
  245.         move.l    d6,d1                get lock
  246.         CALL    UnLock                free lock
  247.  
  248. ** This next part will be a little confusing if you read it, basically I try to
  249. ** see if the user specified a PATTERN (e.g. c:a*) or a DIRECTORY (c:). If it
  250. ** Is a directory, I have to AddPart a '/#?' to get all entrys of the directory,
  251. ** because MatchFirst/MatchNext() will think it has already done its job when it
  252. ** finds C:. Got that ??
  253.  
  254.         lea    (fileinfoblock),a0        fileinfoblock 
  255.         move.l    (fib_DirEntryType,a0),d0    get type (dir/file)
  256.         btst    #31,d0                =negative ?
  257.         beq    3$                yep, is a directory
  258. .nodirlock    lea    (anchorpath),a0            anchor path
  259.         move.l    a0,d2                get it
  260.         move.l    #SIGBREAKF_CTRL_C,(ap_BreakBits,a0) set breakbit = CTRL-C
  261.         move.l    #volname,d1            name of volume
  262.         CALL    MatchFirst,dos.base        get first match
  263.         tst.l    d0                test if error
  264.         bne    vol.matcherror            yes, quit
  265.         lea    (anchorpath+ap_Info+fib_FileName),a0 get filename (rather volumename)
  266.         tst.b    (a0)                is it there ?
  267.         bne.b    2$                yo! continue
  268.         move.l    #anchorpath,d1            else get path
  269.         CALL    MatchEnd            and free it
  270. 3$        move.l    #volname,d1            volumename
  271.         move.l    #addpart.msg,d2            '/#?',0
  272.         move.l    #MAX_PATHSIZE,d3        maximum path = 1024
  273.         CALL    AddPart                here it is !
  274.         cmp.l    #DOSFALSE,d0            error ?
  275.         beq    vol.doserror            yep, quit
  276.         lea    (anchorpath),a0            anchorpath
  277.         move.l    a0,d2                get a copy
  278.         move.l    #SIGBREAKF_CTRL_C,(ap_BreakBits,a0) set break = CTRL_C
  279.         move.l    #volname,d1            name of volume
  280.         CALL    MatchFirst,dos.base        find first match
  281.         tst.l    d0                error ?
  282.         bne    vol.matcherror            yo once again quit
  283. 2$        lea    (volname),a0            name of volume
  284.         move.l    #MAX_PATHSIZE-1,d0        size = 1024
  285. .clearpath    clr.b    (a0)+                clear string
  286.         dbra    d0,.clearpath            continue looping
  287.  
  288. ** Now, we get the full pathname of the volume
  289.  
  290.         lea    (anchorpath),a0            Path
  291.         move.l    (ap_Current,a0),a0        ptr to current item
  292.         move.l    (an_Lock,a0),d1            lock
  293.         move.l    #volname,d2            name which will contain the path
  294.         move.l    #MAX_PATHSIZE,d3        maximum = 1024
  295.         CALL    NameFromLock            get name from lock
  296.         tst.l    d0                error ?
  297.         beq    vol.doserror            yes, done
  298.  
  299.         jsr    GETDISKINFO            get INFO-like stuff
  300.  
  301. ** Finally we start displaying ! (Yipee!)
  302.  
  303.         move.b    #-1,(rowcount)            rowcount = 1..3 etc
  304. showdirectory    lea    (anchorpath),a4            anchorpath
  305.  
  306. ** Check if HIDDEN-bit is set
  307.  
  308.         move.l    (ap_Info+fib_Protection,a4),d0    get protection
  309.         btst    #7,d0                check if hidden
  310.         beq.b    .not.hidden            no, continue
  311.         tst.l    (arg.nohidden)            dow have to ch
  312.         bne    continue            no,continue
  313. .not.hidden    
  314.  
  315. ** Check if it is a Directory
  316.  
  317.         move.l    (ap_Info+fib_DirEntryType,a4),d0 get entry type 
  318.         clr.b    (dirflag)            not a directory [=default]
  319.         btst    #31,d0                is negative ?
  320.         bne.b    1$                yo, it's no directory
  321.         move.b    #1,(dirflag)            else set flag
  322. 1$
  323.  
  324. ** Now for several time-checks !
  325.  
  326. timecheck    tst.l    (arg.today)            TODAY keyword
  327.         beq.b    .not_today            not specified
  328.         bsr    checkdates            compare dates
  329.         bne    continue            not equal => abort
  330. .not_today    tst.l    (arg.since)            SINCE keyword
  331.         beq.b    .not_since            not specified
  332.         bsr    checkdates2            compare dates
  333.         blo    continue            less => abort
  334. .not_since    tst.l    (arg.upto)            UPTO keyword
  335.         beq.b    .not_upto            not specified
  336.         bsr    checkdates2            compare dates
  337.         bhi    continue            higher => abort
  338. .not_upto    tst.l    (arg.newer)            NEWER keyword
  339.         beq.b    .not_newer            not specified
  340.         bsr    checkdates2            compare dates
  341.         blo    continue            less => abort
  342. .not_newer    tst.l    (arg.older)            OLDER keyword
  343.         beq.b    .not_older            not specified
  344.         bsr    checkdates2            compare dates
  345.         bhi    continue            higher => abort
  346. .not_older
  347.  
  348. ** Now for some thing which could be placed somewhere else,too but well,
  349. ** it's here and who cares anyway ?!
  350.  
  351. setreturn    lea    (anchorpath),a4         anchorpath
  352.         lea    (ap_Info+fib_FileName,a4),a1    get filename
  353.         move.l    a1,(filename)            save if !!
  354.  
  355.         tst.l    (arg.all)            test if argument = all
  356.         beq    nextfile            no, continue examination
  357.  
  358. ** Yo, and here is the ALL-section, which needs some treatment with MatchNext()..
  359.  
  360.         tst.b    (dirflag)            is it a dir ?
  361.         beq    nextfile            no, well done!
  362.  
  363.         bsr    getfull.fname            get full pathname
  364.  
  365. ** Handle DIDDIR (directory has just been done, returning to parent level)
  366.  
  367.         move.b    (ap_Flags,a4),d0        get anchorpath flags
  368.         btst    #APB_DIDDIR,d0            DIR just DONE
  369.         beq.b    1$                no, continue
  370.         PUSHR    d0                save flags
  371.         tst.l    (arg.fullpath)            fullpath ?
  372.         bne.b    .not1                yep, no need for [>(path)]
  373.         tst.l    (arg.list)            list option ?
  374.         bne.b    .l1                no, display normal type
  375.         bsr    checkdir.return            check for return
  376.         printfc    diddir.msg2,filename        print norm-style message
  377.         bra.b    .not1                continue
  378. .l1        printfc    diddir.msg,filename        else print list-style
  379. .not1        PULLR    d0                restore flags
  380.         bra    2$                continue
  381.  
  382. ** DODIR says that we want to examine this directory (some strange guys will
  383. ** want to include a possible 'ASK' option here, but well it's YOUR problem really..
  384.  
  385. 1$        bset    #APB_DODIR,d0            set flag = DODIR
  386.         PUSHR    d0                save flags
  387.         addq.l    #1,(NROF_dirs)            more of those dirs 
  388.         tst.l    (arg.fullpath)            fullpath ?
  389.         bne.b    .show2                 yes, show it !
  390.         tst.l    (arg.list)            list ?
  391.         bne.b    .l2                yes, show it
  392.         bsr    checkdir.return            else (possible) return
  393.         printfc    dodir.msg2,filename        print [>(path)]
  394.         bra.b    .not2                continue
  395. .show2        printfc    fndir.msg,filename        special for 'fullpath all' mode
  396.         bra.b    .not2                continue
  397. .l2        printf    dodir.msg,filename        print list-type 
  398. .not2        PULLR    d0                restore flags
  399. 2$        bclr    #APB_DIDDIR,d0            set flag [ so no errors ]
  400.         move.b    d0,(ap_Flags,a4)        save flags
  401.         bra    nofileinfo            continue
  402.  
  403. ** Analyze Flags
  404.  
  405. nextfile    
  406.  
  407. ** Handle FILES/DIRS options
  408.  
  409.         tst.l    (arg.filesonly)            FILES option ?            
  410.         beq.b    1$                no, continue
  411.         tst.b    (dirflag)            chk if we have a directory
  412.         bne    continue            yes, continue
  413. 1$        tst.l    (arg.dirsonly)            DIRS option ?            
  414.         beq.b    2$                no, continue
  415.         tst.b    (dirflag)            chk if we have a directory
  416.         beq    continue            no, continue
  417. 2$
  418.  
  419. ** Handle the LARGER/SMALLER options
  420.  
  421.         move.l    (ap_Info+fib_Size,a4),d0    get size of file
  422.         tst.l    (arg.larger)            LARGER option ?
  423.         beq.b    not.larger            no continue
  424.         move.l    (arg.larger),a0            get argument
  425.         move.l    (a0),d1                get argument size
  426.         cmp.l    d1,d0                compare with current size
  427.         bls    continue            quit if LARGER            
  428. not.larger    tst.l    (arg.smaller)            SMALLER option ?
  429.         beq.b    not.smaller            no continue
  430.         move.l    (arg.smaller),a0        get argument
  431.         move.l    (a0),d1                get argument size
  432.         cmp.l    d1,d0                compare with current size
  433.         bhs    continue            quit if SMALLER            
  434. not.smaller
  435.  
  436. ** Display HEAD-message if appropriate
  437.  
  438.         tst.b    (anyentry.flag)            already HEADed ?
  439.         bne.b    head.is.there            yo, continue
  440.         printfc    head.msg,headname        print HEAD-msg
  441.         move.b    #-1,(anyentry.flag)        set HEADed flag
  442. head.is.there
  443.  
  444. ** Display [RETURN] if needed
  445.  
  446.         tst.l    (arg.fullpath)            FULLPATH ?
  447.         bne.b    .noreturn            yo, we don't need RETURNs
  448.         addq.b    #1,(rowcount)            next row
  449.         move.b    (maxrows),d0            maxrows 
  450.         cmp.b    (rowcount),d0            compare ?
  451.         bne.b    .noreturn            not yet
  452.         clr.b    (rowcount)            reset
  453.         printf    return.msg            print RETURN
  454. .noreturn    
  455.  
  456. ** Update counters for files,dirs,blocks and bytes (what's missing ? yes, BLEEPS! are missing)
  457.  
  458.         move.l    (ap_Info+fib_NumBlocks,a4),d0    nr of blocks
  459.         add.l    d0,(NROF_blocks)        shit I only got damn 68000
  460.         move.l    (ap_Info+fib_Size,a4),d0    size of the entry
  461.         add.l    d0,(NROF_bytes)            add to total bytes
  462.         tst.b    (dirflag)            is it a dir ?
  463.         bne.b    .is.a.dir            yo 
  464.         addq.l    #1,(NROF_files)            add nr of files
  465.         bra.b    .is.nothing            continue
  466. .is.a.dir    addq.l    #1,(NROF_dirs)            else add nr of dirs
  467. .is.nothing    
  468.  
  469. ** Do according to the type-flags (VERBOSE,SHORT,LIST or 'NORMAL')
  470.         
  471.         tst.l    (arg.verbose)            verbose ?
  472.         bne    verbose.display            yes -> display verbose action
  473.         tst.l    (arg.short)            short ?
  474.         bne    short.display            yes -> display short action
  475.         tst.l    (arg.list)            list ?
  476.         bne    list.display            yes -> display list action
  477.  
  478. ** 'NORMAL' display (not supplied as keyword really, this is the default choice
  479.  
  480. ** (Note that the code may look a little bit confusing but a) you should know that
  481. ** by now, and b) I did it step after step so there are some -eh- inconsistencys
  482.  
  483. ** (Hey, be glad that I commented this one! Just a few years ago I used not only
  484. ** to reduce my comments to lyrics from the songs I listend to while coding, I
  485. ** also used labels like 'OIUsXOJ' and 'shitFUCK' (case sensitive, of course)
  486. ** [and of course didn't use INCLUDEs but absolute hex offsets...] haha)
  487.  
  488. ** (This is a nested IF-THEN-ELSE construct anyway)
  489.  
  490.         move.l    (ap_Info+fib_Size,a4),(filesize) get size of thee file
  491.         tst.l    (arg.fullpath)            is it full-path type ?
  492.         bne.b    .fullpath.norm            yes, the show it
  493.         tst.b    (dirflag)            directory ?
  494.         bne.b    1$                yes, show it
  495.         printf    nfile.msg,filename        display file
  496.         bra    continue            done
  497. 1$        printfc    ndir.msg,filename        display directory
  498.         bra    continue            done
  499. .fullpath.norm    bsr    getfull.fname            get full pathname
  500.         tst.b    (dirflag)            directory ?
  501.         bne.b    2$                yes, show it
  502.         printf    fnfile.msg,filename        display file
  503.         bra    continue            done
  504. 2$        printfc    fndir.msg,filename        display directory
  505.         bra    continue            done
  506.  
  507. ** SHORT display
  508.     
  509. short.display    tst.b    (dirflag)            directory ?
  510.         bne.b    1$                yes, show it
  511.         printf    sfile.msg,filename        display file
  512.         bra    continue            done
  513. 1$        printfc    sdir.msg,filename        display directory
  514.         bra    continue            done
  515.  
  516. ** LIST-lookalike display
  517.  
  518. list.display    bsr    getextinfo.1            get list-info
  519.         tst.l    (arg.fullpath)            FULLPATH ?
  520.         bne.b    .fullpath.list            yo, bring the noise
  521.         tst.b    (dirflag)            directory ?        
  522.         bne.b    1$                yes, show it
  523.         printf    lfile.msg,filename        display file
  524.         bra    .continue.list            done
  525. 1$        printfc    ldir.msg,filename        display directory
  526.         bra    .continue.list            done
  527. .fullpath.list    bsr     getfull.fname            get full pathname
  528.         tst.b    (dirflag)            directory ?
  529.         bne.b    2$                yes, show it
  530.         printf    flfile.msg,filename        display file
  531.         bra.b    .continue.list2            continue
  532. 2$        printfc    fldir.msg,filename        display directory [this construct isn't 'clean' but it works]
  533. .continue.list2    printfc    flinfo.msg,protstring        print info message
  534.         tst.l    (comment)            comment ?    
  535.         beq    continue            no continue
  536.         printfc    fcomment.msg,comment        print comment
  537.         bra    continue            continue
  538.  
  539. .continue.list    printfc    linfo.msg,protstring        protection ?
  540.         tst.l    (comment)            comment ?    
  541.         beq    continue            no continue
  542.         printfc    comment.msg,comment        print comment
  543.         bra    continue            continue
  544.  
  545. ** VERBOSE-type display
  546.  
  547. verbose.display    bsr    getextinfo.1            get extended information
  548.  
  549.         lea    (anchorpath),a4            anchorpath
  550.         move.l    (ap_Info+fib_EntryType,a4),(v_entrytype) type of entry
  551.         move.l    (ap_Info+fib_DiskKey,a4),(v_diskkey) blockheader for entry
  552.  
  553.         bsr     getfull.fname            get fullpath [default for VERBOSE]
  554.         tst.b    (dirflag)                    directory ?        
  555.         bne.b    2$                yes, show it
  556.         printf    flfile.msg,filename        display file
  557.         bra.b    1$                done
  558. 2$        printfc    fldir.msg,filename        display directory
  559. 1$        printfc    fvinfo.msg,protstring2        print x-tended information
  560.         tst.l    (comment)            comment ?    
  561.         beq    continue            no continue
  562.         printfc    fcomment.msg,comment        print comment
  563.         bra    continue            continue
  564.  
  565. continue
  566.  
  567. ** Get next file
  568.  
  569. nofileinfo    move.l    #anchorpath,d1            get match-anchor 
  570.         CALL    MatchNext            next file
  571.         tst.l    d0                error ?
  572.         beq    showdirectory            no continue [this seems a strange returncode but it's true!]
  573.         PUSHR    d0                save error code
  574.         tst.l    (arg.fullpath)            FULLPATH ?
  575.         bne.b    .noreturn            no, continue
  576.         tst.b    (anyentry.flag)            any entry displayed ?
  577.         beq.b    .noreturn            no, continue
  578.         printf    return.msg            RETURN!
  579. .noreturn    PULLR    d0                get error code
  580.         cmp.l    #ERROR_NO_MORE_ENTRIES,d0    is it 'end of directory'
  581.         bne.b    vol.matcherror            no, error !
  582.  
  583. ** Quit subroutine
  584.  
  585.         move.l    #anchorpath,d1            match-anchor
  586.         CALL    MatchEnd            close it [freemem]
  587.         tst.b    (anyentry.flag)            have there been any entrys ?
  588.         beq.b    1$                no, continue
  589.         printfc    volinfo.msg,NROF_files        display info message
  590.         bra.b    2$                continue
  591. 1$        printf    vol_noentry.msg,headname    print fault message
  592. 2$        PULLALL                    restore registers
  593.         rts                    return
  594.  
  595.  
  596. ** Display DOS-Errormsg
  597.  
  598. vol.doserror    CALL    IoErr                get IOerror
  599. vol.matcherror    move.l    d0,d1                copy
  600.         move.l    #err.head,d2            header ='ERROR:'
  601.         CALL    PrintFault            print error message
  602.         PULLALL                    restore registers
  603.         rts                    return
  604.  
  605. ** Get ExtendedInformation #1
  606.  
  607. getextinfo.1    PUSHALL                    store registers
  608.         move.l    (ap_Info+fib_Size,a4),(filesize) size of file
  609.         move.l    (ap_Info+fib_NumBlocks,a4),(nrofblocks) nr of blocks
  610.         move.l    (ap_Info+fib_NumBlocks,a4),(nrofblocks2) copy #2
  611.         move.l    (ap_Info+fib_Protection,a4),d0    protection 
  612.         bsr    get.protstring            => protection string
  613.         lea    (datetime),a0            date/time struct
  614.         move.l    a0,d1                copy
  615.         lea    (ap_Info+fib_DateStamp,a4),a1    date of current entry
  616.         move.l    (a1)+,(a0)+            copy days
  617.         move.l    (a1)+,(a0)+            copy minutes
  618.         move.l    (a1)+,(a0)+            copy tickx
  619.         bsr    norm.dates            normative dates
  620.         CALL    DateToStr            get date/time string
  621.         clr.l    (comment)            no comment [default]
  622.         lea    (ap_Info+fib_Comment,a4),a1    get comment string
  623.         tst.b    (a1)                is there any ?
  624.         beq    .nocomment            no,continue
  625.         move.l    a1,(comment)            save comment
  626. .nocomment    PULLALL                    restore registers
  627.         rts                    return
  628.  
  629. ** Set norm dates [handle DATES/NODATES option]
  630.  
  631. norm.dates    PUSHR    a0                save a0
  632.         lea    (datetime),a0            get date/time struct
  633.         move.b    #DTB_SUBST|DTB_FUTURE,(dat_Flags,a0) normal = substitute
  634.         tst.l    (arg.dates)            test DATES
  635.         beq.b    1$                not selected
  636.         clr.b    (dat_Flags,a0)            no substitution
  637. 1$        PULLR    a0                restore a0
  638.         rts                    return
  639.  
  640.  
  641. * This section deals with the argument conflict resolving. I don't comment
  642. * it because a) I'm bored, b) it's 1.00 AM and c) you know it anyway
  643.  
  644. ;         argument hierarchy :
  645. ;        ~~~~~~~~~~~~~~~~~~~~
  646. ;        1. fullpath
  647. ;        2. all
  648. ;         3. verbose    x
  649. ;        4. list        x (all three mutual exclusive)
  650. ;        5. short    x
  651. ;        6. normal    x
  652. ;        7. all comparison flags, dont conflict with any of the above
  653.  
  654. ;        further collisions :
  655. ;        ~~~~~~~~~~~~~~~~~~~~
  656. ;        ALL<>(SHORT,NORMAL)
  657. ;        FULLPATH<>(SHORT,NORMAL)
  658. ;        HIDDEN<>NOHIDDEN
  659. ;        COLOR<>NOCOLOR
  660. ;        DATES<>NODATES
  661.     
  662. setupargs    tst.l    (arg.fullpath)
  663.         beq    .not.fullpath
  664.         clr.l    (arg.short)
  665. .not.fullpath    tst.l    (arg.all)
  666.         beq    .not.all
  667.         clr.l    (arg.short)
  668. .not.all    tst.l    (arg.verbose)
  669.         beq.b    .not.verbose
  670.         move.l    #1,(arg.list)
  671.         move.l    #1,(arg.fullpath)
  672.         clr.l    (arg.short)
  673.         bra.b    setuprows
  674. .not.verbose    tst.l    (arg.list)
  675.         beq.b    setuprows
  676.         clr.l    (arg.short)
  677. setuprows    move.b    #3,(maxrows)
  678.         tst.l    (arg.short)
  679.         beq.b    1$
  680.         move.b    #4,(maxrows)
  681. 1$        tst.l    (arg.list)
  682.         beq.b    2$
  683.         move.b    #1,(maxrows)
  684. 2$        tst.l    (arg.fullpath)
  685.         beq.b    4$
  686.         move.b    #1,(maxrows)
  687. 4$        tst.l    (arg.since)
  688.         beq.b    5$
  689.         clr.l    (arg.upto)
  690. 5$        tst.l    (arg.smaller)
  691.         beq.b    6$
  692.         clr.l    (arg.larger)
  693.         move.l    #1,(arg.filesonly)
  694. 6$        tst.l    (arg.larger)
  695.         beq.b    7$
  696.         move.l    #1,(arg.filesonly)
  697. 7$        tst.l    (arg.nohidden)
  698.         beq.b    8$
  699.         clr.l    (arg.hidden)
  700. 8$        tst.l    (arg.nodates)
  701.         beq.b    9$
  702.         clr.l    (arg.dates)
  703. 9$        tst.l    (arg.nocolor)
  704.         beq.b    10$
  705.         clr.l    (arg.color)
  706. 10$        rts
  707.  
  708. ** This subroutine analyzes the packet protection and copies it to thee protection string
  709.  
  710. get.protstring    PUSHALL
  711.         lea    (protstring.data),a0
  712.         movem.l    a0/d0,-(sp)
  713.         moveq    #8-1,d0
  714. .clear        move.b    #'-',(a0)+
  715.         dbra    d0,.clear
  716.         clr.b    (a0)+
  717.         movem.l    (sp)+,a0/d0
  718.         btst    #7,d0
  719.         beq.b    7$
  720.         move.b    #'h',(0,a0)
  721. 7$        btst    #6,d0
  722.         beq.b    6$
  723.         move.b    #'s',(1,a0)
  724. 6$        btst    #5,d0
  725.         beq.b    5$
  726.         move.b    #'p',(2,a0)
  727. 5$        btst    #4,d0
  728.         beq.b    4$
  729.         move.b    #'a',(3,a0)
  730. 4$        btst    #3,d0
  731.         bne.b    3$
  732.         move.b    #'r',(4,a0)
  733. 3$        btst    #2,d0
  734.         bne.b    2$
  735.         move.b    #'w',(5,a0)
  736. 2$        btst    #1,d0
  737.         bne.b    1$
  738.         move.b    #'e',(6,a0)
  739. 1$        btst    #0,d0
  740.         bne.b    10$
  741.         move.b    #'d',(7,a0)
  742. 10$        PULLALL
  743.         rts
  744.  
  745. ** Get full pathname from a lock
  746.  
  747. getfull.fname    PUSHALL                    store all registers
  748.         lea    (anchorpath),a0            anchor path
  749.         move.l    (ap_Current,a0),a0        current entry
  750.         move.l    (an_Lock,a0),d1            current lock
  751.         move.l    #volname,d2            name to hold path
  752.         move.l    #MAX_PATHSIZE,d3        size of buffer
  753.         CALL    NameFromLock            get name from lock
  754.  
  755.         move.l    #volname,d1            name to hold path
  756.         lea    (anchorpath),a0            anchor path
  757.         lea    (ap_Info+fib_FileName,a0),a0    filename
  758.         move.l    a0,d2                get a ptr to tha filename
  759.         move.l    #MAX_PATHSIZE,d3        size of buffer
  760.         CALL    AddPart                get filename + volume = full path
  761.  
  762.         move.l    #volname,(filename)        store it to a internal pointer
  763.         PULLALL                    restore registers
  764.         rts
  765.  
  766. checkdir.return    cmp.b    #-1,(rowcount)
  767.         beq.b    1$
  768.         printf    return.msg
  769.         move.b    #-1,(rowcount)
  770. 1$        rts
  771.     
  772. get.cmpdate    lea    (Cmpdatetime),a4
  773.         move.b    #FORMAT_DOS,(dat_Format,a4)
  774.         move.b    #DTB_SUBST|DTB_FUTURE,(dat_Flags,a4)
  775.         clr.l    (dat_StrDay,a4)
  776.         move.l    #CmpDate.msg,(dat_StrDate,a4)
  777.         clr.l    (dat_StrTime,a4)
  778.         lea    (CmpDate.msg),a0
  779.         move.l    #LEN_DATSTRING-1,d0
  780. 1$        move.b    (a1)+,(a0)+
  781.         dbra    d0,1$
  782.         move.l    a4,d1
  783.         CALL    StrToDate
  784.         rts
  785.  
  786. checkdates    lea    (Cmpdatetime),a3
  787.         move.l    a3,d1
  788.         CALL    DateStamp
  789. checkdates2    lea    (Cmpdatetime),a3 ; compare(Cmpdatetime,datetime)
  790.         move.l    (a3),d0
  791.         lea    (anchorpath),a4
  792.         move.l    (ap_Info+fib_DateStamp,a4),d1
  793.         cmp.l    d0,d1
  794.         rts
  795.  
  796. open.cmpfile    move.l    a0,d1
  797.         move.l    #ACCESS_READ,d2
  798.         CALL    Lock
  799.         tst.l    d0
  800.         beq    .failed
  801.         move.l    d0,d6
  802.         move.l    d0,d1
  803.         move.l    #compareblock,d2
  804.         CALL    Examine
  805.         cmp.l    #DOSFALSE,d0
  806.         beq    .failed
  807.         move.l    d6,d1
  808.         CALL    UnLock
  809.         lea    (compareblock),a0
  810.         lea    (Cmpdatetime),a1
  811.         move.l    (fib_DateStamp,a0),(ds_Days,a1)
  812.         moveq    #TRUE,d0
  813.         rts
  814. .failed        moveq    #FALSE,d0
  815.         rts
  816.  
  817. GETDISKINFO    PUSHALL
  818.         move.l    #volname,d1
  819.         move.l    #ACCESS_READ,d2
  820.         CALL    Lock,dos.base
  821.         tst.l    d0
  822.         beq    .failed
  823.         move.l    d0,d6
  824.         move.l    d0,d1
  825.         move.l    #volumeinfoblock,d2
  826.         CALL    Info
  827.         move.l    d6,d1
  828.         CALL    UnLock
  829.         lea    (volumeinfoblock),a3
  830.         lea    (info.shit,pc),a4
  831.  
  832.         move.l    (utility.base),a6
  833.  
  834.         move.l    (id_NumBlocks,a3),d0
  835.         move.l    (id_BytesPerBlock,a3),d1
  836.         bsr    1024$
  837.         move.b    d4,(C_INFOsize1)
  838.         move.b    d4,(C_INFOsize2)
  839.  
  840.         move.l    (id_NumBlocksUsed,a3),d0
  841.         move.l    (id_BytesPerBlock,a3),d1
  842.         bsr    1024$
  843.         move.b    d4,(C_INFOused1)
  844.         move.b    d4,(C_INFOused2)
  845.  
  846.         move.l    (id_NumBlocks,a3),d0
  847.         move.l    (id_NumBlocksUsed,a3),d1
  848.         sub.l    d1,d0
  849.         move.l    (id_BytesPerBlock,a3),d1
  850.         bsr    1024$
  851.         move.b    d4,(C_INFOfree1)
  852.         move.b    d4,(C_INFOfree2)
  853.  
  854.         move.l    (id_NumBlocksUsed,a3),d0
  855.         move.l    #100,d1
  856.         CALL    UMult32
  857.         move.l    (id_NumBlocks,a3),d1
  858.         CALL    UDivMod32
  859.         move.l    d0,(a4)+
  860.  
  861.         move.l    (id_NumSoftErrors,a3),(a4)+
  862.  
  863.         move.l    (id_DiskState,a3),d0
  864.         lea    (status_validating,pc),a0
  865.         cmp.l    #ID_VALIDATED,d0
  866.         bne.b    2$
  867.         lea    (status_validated,pc),a0
  868. 2$        cmp.l    #ID_WRITE_PROTECTED,d0
  869.         bne.b    3$
  870.         lea    (status_writeprotected,pc),a0
  871. 3$        move.l    a0,(a4)+
  872.  
  873.         move.l    (id_DiskType,a3),d0
  874.         lea    (type_unreadable,pc),a0
  875.         cmp.l    #ID_NOT_REALLY_DOS,d0
  876.         bne.b    4$
  877.         lea    (type_notreallydos,pc),a0
  878. 4$        cmp.l    #ID_DOS_DISK,d0
  879.         bne.b    5$
  880.         lea    (type_dosdisk,pc),a0
  881. 5$        cmp.l    #ID_FFS_DISK,d0
  882.         bne.b    6$
  883.         lea    (type_ffsdisk,pc),a0
  884. 6$        cmp.l    #ID_KICKSTART_DISK,d0
  885.         bne.b    7$
  886.         lea    (type_kickstart,pc),a0
  887. 7$        move.l    a0,(a4)+
  888. .failed        PULLALL
  889.         rts
  890.  
  891. 1024$        CALL    UMult32
  892.         move.l    #1024,d1
  893.         CALL    UDivMod32
  894.         move.b    #'k',d4
  895.         cmp.l    #1024,d0
  896.         bls.b    1$
  897.         move.l    #1024,d1
  898.         CALL    UDivMod32        
  899.         moveq    #'m',d4
  900. 1$        move.l    d0,(a4)+
  901.         rts
  902.  
  903. *        This one multiples d1.LONG! with d2.LONG! in d1.LONG
  904. *        if both are only word-sized, MULU is beeing used...
  905.  
  906. ext.mulu    movem.l d1/d2,-(sp)
  907.         cmp.l    #$FFF,d2
  908.         bcc.b    2$
  909.         cmp.l    #$FFF,d0
  910.         bcc.b    2$
  911.         mulu    d2,d0
  912.         movem.l (sp)+,d1/d2
  913.         rts
  914. 2$        moveq    #0,d1
  915.         subq.l    #1,d2
  916. 1$        add.l    d0,d1
  917.         dbra    d2,1$
  918.         move.l    d1,d0
  919.         movem.l (sp)+,d1/d2
  920.         rts
  921.  
  922. dos.name    DOSNAME
  923. utility.name    UTILITYNAME
  924. falsekick.msg    dc.b    "Sorry, you don't have OS2.0 V36 or higher installed",10
  925. falsekick.size    equ    *-falsekick.msg
  926. dateerror.msg    dc.b    "invalid date/time specification",10,0
  927. arg.template    dc.b    "DIR/M,ALL/S,VERBOSE/S,SHORT/S,LIST/S,"
  928.         dc.b    "FULLPATH/S,COLOR/S,NOCOLOR/S,FILES/S,DIRS/S,"
  929.         dc.b    "HIDDEN/S,NOHIDDEN/S,NEWER/K,OLDER/K,TODAY/S,"
  930.         dc.b    "LARGER/K/N,SMALLER/K/N,SINCE/K,UPTO/K,"
  931.         dc.b    "DATES/S,NODATES/S,HELP/S"
  932.         dc.b    0
  933. addpart.msg    dc.b    '#?',0
  934.  
  935.         IFND    OVERSCAN
  936.  
  937. sfile.msg    dc.b    '%-18.18s ',0
  938. sdir.msg    dc.b    '%-18.18s ',0
  939.  
  940. nfile.msg    dc.b    '%-16.16s%8ld ',0
  941. ndir.msg    dc.b    '%-18.18s (DIR) ',0
  942.  
  943. fnfile.msg    dc.b    '%s (%ld Bytes)',10,0
  944. fndir.msg    dc.b    '%s (Directory)',10,0
  945. lfile.msg    dc.b    '%-27.27s %8ld ',0
  946. ldir.msg    dc.b    '%-30.30s (DIR) ',0
  947. flfile.msg    dc.b    '%s (%ld Bytes)',10,0
  948. fldir.msg    dc.b    '%s (Directory)',10,0
  949. linfo.msg    dc.b    '%s %-10.10s %s [%8ld]',0
  950. comment.msg    dc.b    10,":'%s'",0
  951. flinfo.msg    dc.b    '%s %-10.10s %s [%8ld]',10,0
  952. fcomment.msg    dc.b    ":'%s'",10,0
  953. head.msg    dc.b    "Directory of %-41.41s at %-9.9s %s",10
  954.         dc.b    'Size=%ld'
  955. C_INFOsize1    dc.b    'kB Used=%ld'
  956. C_INFOused1    dc.b    'kB Free=%ld'
  957. C_INFOfree1    dc.b    'kB Full=%ld%% Errs=%ld Status=%s Type=%s',10,0
  958. diddir.msg    dc.b    10,"[<'%s']",0
  959. dodir.msg    dc.b    10,"[>'%s']",0 
  960. diddir.msg2    dc.b    "[<'%s']",10,0
  961. dodir.msg2    dc.b    "[>'%s']",10,0
  962. return.msg    dc.b    10,0
  963. fvinfo.msg    dc.b    'P:%s %-8.8s %-10.10s %s B:%-6ld K:%-6ld I:%-2d T:??',10,0
  964. volinfo.msg    dc.b    "%ld Files and %ld Directorys using %ld Bytes and %ld Blocks",10,0
  965.  
  966. ; the colored messages :
  967.  
  968. C_sdir.msg    dc.b    '%-18.18s ',0 
  969. C_ndir.msg    dc.b    '%-18.18s (DIR) ',0
  970. C_fndir.msg    dc.b    '%s (DIR)',10,0
  971. C_ldir.msg    dc.b    '%-30.30s (DIR) ',0
  972. C_fldir.msg    dc.b    '%s (Directory)',10,0
  973. C_linfo.msg    dc.b    '%s %-10.10s %s [%8ld]',0
  974. C_comment.msg    dc.b    10,":'%s'",0
  975. C_flinfo.msg    dc.b    '%s %-10.10s %s [%8ld]',10,0
  976. C_fcomment.msg    dc.b    ":'%s'",10,0
  977. C_head.msg    dc.b    "Directory of %-41.41s at %-9.9s %s",10
  978.         dc.b    'Size=%ld'
  979. C_INFOsize2    dc.b    'kB Used=%ld'
  980. C_INFOused2    dc.b    'kB Free=%ld'
  981. C_INFOfree2    dc.b    'kB Full=%ld%% Errs=%ld Status=%s Type=%s',10,0
  982.  
  983. C_diddir.msg    dc.b    10,"[<'%s']",0
  984. C_dodir.msg    dc.b    10,"[>'%s']",0
  985. C_diddir.msg2    dc.b    "[<'%s']",10,0
  986. C_dodir.msg2    dc.b    "[>'%s']",10,0
  987. C_fvinfo.msg    dc.b    'P:%s %-8.8s %-10.10s %s B:%-6ld K:%-6ld I:%-2d T:??',10,0
  988. C_volinfo.msg    dc.b    "%ld Files and %ld Directorys using %ld Bytes and %ld Blocks",10,0
  989.  
  990.         ELSE
  991.  
  992. sfile.msg    dc.b    '%-20.20s ',0
  993. sdir.msg    dc.b    '%-20.20s ',0
  994. nfile.msg    dc.b    '%-20.20s%8ld ',0
  995. ndir.msg    dc.b    '%-22.22s (DIR) ',0
  996. fnfile.msg    dc.b    '%s (%ld Bytes)',10,0
  997. fndir.msg    dc.b    '%s (Directory)',10,0
  998. lfile.msg    dc.b    '%-37.37s %8ld ',0
  999. ldir.msg    dc.b    '%-40.40s (DIR) ',0
  1000. flfile.msg    dc.b    '%s (%ld Bytes)',10,0
  1001. fldir.msg    dc.b    '%s (Directory)',10,0
  1002. linfo.msg    dc.b    '%s %-10.10s %s [%8ld]',0
  1003. comment.msg    dc.b    10,":'%s'",0
  1004. flinfo.msg    dc.b    '%s %-10.10s %s [%8ld]',10,0
  1005. fcomment.msg    dc.b    ":'%s'",10,0
  1006. head.msg    dc.b    "Directory of %-51.51s at %-9.9s %s",10
  1007.          dc.b    'Size=%ld'
  1008. C_INFOsize1    dc.b    'kB Used=%ld'
  1009. C_INFOused1    dc.b    'kB Free=%ld'
  1010. C_INFOfree1    dc.b    'kB Full=%ld%% Errs=%ld Status=%s Type=%s',10,0
  1011.  
  1012. diddir.msg    dc.b    10,"[<'%s']",0
  1013. dodir.msg    dc.b    10,"[>'%s']",0 
  1014. diddir.msg2    dc.b    "[<'%s']",10,0
  1015. dodir.msg2    dc.b    "[>'%s']",10,0
  1016. return.msg    dc.b    10,0
  1017. fvinfo.msg    dc.b    'P:%s %-8.8s %-10.10s %s B:%-6ld K:%-6ld I:%-2d T:NOT_IMPLEMENTED',10,0
  1018. volinfo.msg    dc.b    "%ld Files and %ld Directorys using %ld Bytes and %ld Blocks",10,0
  1019.  
  1020. ; the colored messages :
  1021.  
  1022. C_sdir.msg    dc.b    '%-20.20s ',0 
  1023. C_ndir.msg    dc.b    '%-22.22s (DIR) ',0
  1024. C_fndir.msg    dc.b    '%s (DIR)',10,0
  1025. C_ldir.msg    dc.b    '%-40.40s (DIR) ',0
  1026. C_fldir.msg    dc.b    '%s (Directory)',10,0
  1027. C_linfo.msg    dc.b    '%s %-10.10s %s [%8ld]',0
  1028. C_comment.msg    dc.b    10,":'%s'",0
  1029. C_flinfo.msg    dc.b    '%s %-10.10s %s [%8ld]',10,0
  1030. C_fcomment.msg    dc.b    ":'%s'",10,0
  1031. C_head.msg    dc.b    "Directory of %-51.51s at %-9.9s %s",10
  1032.         dc.b    'Size=%ld'
  1033. C_INFOsize2    dc.b    'kB Used=%ld'
  1034. C_INFOused2    dc.b    'kB Free=%ld'
  1035. C_INFOfree2    dc.b    'kB Full=%ld%% Errs=%ld Status=%s Type=%s',10,0
  1036. C_diddir.msg    dc.b    10,"[<'%s']",0
  1037. C_dodir.msg    dc.b    10,"[>'%s']",0
  1038. C_diddir.msg2    dc.b    "[<'%s']",10,0
  1039. C_dodir.msg2    dc.b    "[>'%s']",10,0
  1040. C_fvinfo.msg    dc.b    'P:%s %-8.8s %-10.10s %s B:%-6ld K:%-6ld I:%-2d T:NOT_IMPLEMENTED',10,0
  1041. C_volinfo.msg    dc.b    "%ld Files and %ld Directorys using %ld Bytes and %ld Blocks",10,0
  1042.  
  1043.         ENDC
  1044.  
  1045. ; other messages
  1046.  
  1047. vol_noentry.msg dc.b "no more entries in directory",10,0
  1048.  
  1049. help.msg    dc.b    'Deluxe Directory Version '
  1050.         version
  1051.         dc.b    ' written by G.Kurz in 1991',10
  1052.         dc.b    ' Syntax : DDIR [directory(s)] [OPTIONS]',10
  1053.         dc.b    'Options :       ALL - enter all subdirectorys',10
  1054.         dc.b    '            VERBOSE - be verbose as to the information given',10
  1055.         dc.b    '              SHORT - 4 entrys in a row, no filesizes',10
  1056.         dc.b    '               LIST - list-lookalike',10
  1057.         dc.b    '           FULLPATH - display full path of names',10
  1058.         dc.b    '              COLOR - show colorized messages [default]',10
  1059.         dc.b    '            NOCOLOR - don''t use colors',10
  1060.         dc.b    '              FILES - display files only',10
  1061.         dc.b    '               DIRS - display directorys only',10
  1062.         dc.b    '             HIDDEN - show hidden files [default]',10
  1063.         dc.b    '           NOHIDDEN - don''t show hidden files',10
  1064.         dc.b    '       NEWER=object - show files only newer or equal to this',10
  1065.         dc.b    '       OLDER=object - show files only older or equal to this',10
  1066.         dc.b    '              TODAY - show all files of today',10
  1067.         dc.b    '        LARGER=size - show all files larger than this',10
  1068.         dc.b    '       SMALLER=size - show all files smaller than this',10
  1069.         dc.b    '         SINCE=date - show all files since this day',10
  1070.         dc.b    '          UPTO=date - show all files upto this day',10
  1071.         dc.b    '              DATES - show real dates (don''t use ''Today'' etc.)',10
  1072.         dc.b    '            NODATES - use replace-strings if available [default]',10
  1073.         dc.b    '               HELP - display this message',10
  1074.         dc.b    0
  1075. err.head    dc.b    'ERROR:',0
  1076.  
  1077.         even
  1078. headname    dc.l    volname
  1079.         dc.l    StrDate.msg
  1080.         dc.l    StrTime.msg
  1081.  
  1082. info.shit    dc.l    0    ; Size
  1083.         dc.l    0    ; Used
  1084.         dc.l    0    ; Free
  1085.         dc.l    0    ; Full
  1086.         dc.l    0    ; Errs
  1087.         dc.l    0    ; Status
  1088.         dc.l    0    ; type
  1089.  
  1090. status_validating dc.b    'VALIDATING',0
  1091. status_validated dc.b    'READ/WRITE',0
  1092. status_writeprotected dc.b 'READ',0
  1093.  
  1094. type_unreadable    dc.b    'BAD',0
  1095. type_notreallydos dc.b    'NDOS',0
  1096. type_dosdisk    dc.b    'DOS',0
  1097. type_ffsdisk    dc.b    'FFS',0
  1098. type_kickstart    dc.b    'KICK',0
  1099.  
  1100.         even
  1101.  
  1102. protstring    dc.l    protstring.data
  1103.         dc.l    StrDate.msg
  1104.         dc.l    StrTime.msg
  1105. nrofblocks    ds.l    1
  1106.  
  1107. protstring2    dc.l    protstring.data
  1108.         dc.l    StrDay.msg
  1109.         dc.l    StrDate.msg
  1110.         dc.l    StrTime.msg
  1111. nrofblocks2    ds.l    1
  1112. v_diskkey    ds.l    1
  1113. v_entrytype    ds.l    1
  1114.  
  1115.         SECTION    nirvana,BSS
  1116.  
  1117. BSS_START
  1118. arg.dirs    ds.l    1
  1119. arg.all        ds.l    1
  1120. arg.verbose    ds.l    1
  1121. arg.short    ds.l    1
  1122. arg.list    ds.l    1
  1123. arg.fullpath    ds.l    1
  1124. arg.color    ds.l    1
  1125. arg.nocolor    ds.l    1
  1126. arg.filesonly    ds.l    1
  1127. arg.dirsonly    ds.l    1
  1128. arg.hidden    ds.l    1
  1129. arg.nohidden    ds.l    1
  1130. arg.newer    ds.l    1
  1131. arg.older    ds.l    1
  1132. arg.today    ds.l    1
  1133. arg.larger    ds.l    1
  1134. arg.smaller    ds.l    1
  1135. arg.since    ds.l    1
  1136. arg.upto    ds.l    1
  1137. arg.dates    ds.l    1
  1138. arg.nodates    ds.l    1
  1139. arg.help    ds.l    1
  1140.  
  1141. dos.base    ds.l    1
  1142. utility.base    ds.l    1
  1143. arg.rdargs    ds.l    1
  1144. filename    ds.l    1
  1145. filesize    ds.l    1
  1146. comment        ds.l    1
  1147. NROF_files    ds.l    1
  1148. NROF_dirs    ds.l    1
  1149. NROF_bytes    ds.l    1
  1150. NROF_blocks    ds.l    1
  1151. anchorpath    ds.b    ap_SIZEOF
  1152. volname        ds.b    MAX_PATHSIZE
  1153. fileinfoblock    ds.b    fib_SIZEOF
  1154. datetime    ds.b    dat_SIZEOF
  1155. StrDay.msg    ds.b    LEN_DATSTRING
  1156. StrDate.msg    ds.b    LEN_DATSTRING
  1157. StrTime.msg    ds.b    LEN_DATSTRING
  1158. Cmpdatetime    ds.b    dat_SIZEOF
  1159. CmpDay.msg    ds.b    LEN_DATSTRING
  1160. CmpDate.msg    ds.b    LEN_DATSTRING
  1161. CmpTime.msg    ds.b    LEN_DATSTRING
  1162. rowcount    ds.b    1
  1163. dirflag        ds.b    1
  1164. maxrows        ds.b    1
  1165. anyentry.flag    ds.b    1
  1166.         even
  1167. protstring.data    ds.b    9
  1168.         cnop    0,4
  1169. compareblock    ds.b    fib_SIZEOF
  1170.         cnop    0,4
  1171. volumeinfoblock    ds.b    id_SIZEOF
  1172.  
  1173. BSS_SIZE    equ    *-BSS_START
  1174.  
  1175.         END
  1176.